/*
 * Main Window implementation
 */ 

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
// C++ Stuff
#include <iostream>
#include <sstream>
using namespace std;

#include <QMainWindow>
#include <QAction>
#include <QLabel>
#include <QScrollBar>
#include <QPushButton>
#include <QGridLayout>
#include <QSizePolicy>
#include <QFontMetrics>

#include <QDebug>

#include "plotarea.h"

class MainWindow : public QMainWindow {

  Q_OBJECT

public:
  MainWindow( char* fileName, vector<float> &data);

protected:
  void closeEvent(QCloseEvent *event);

public slots:
  void setMouseLabel( int xPos, int yPos, int dxPos, int dyPos );
  void setAxisLabel( int numXTicks, int numYTicks, float *xLoc, float *yLoc, float *xVals, float *yVals);
private slots:
  void newFile();
  void open();
  bool save();
  bool saveAs();
  void about();
  void help();

signals:
  void fileOpen();

private:
  void createActions();
  void createMenus();
  void centerWindow( QMainWindow *window );
    
  QMenu *fileMenu;
  QMenu *helpMenu;
  
  QAction *newAction;
  QAction *openAction;
  QAction *saveAction;
  QAction *exitAction;
  QAction *helpAction;
  QAction *aboutAction;
  QAction *saveAsAction;
  // Gui items
  QLabel *xyDataType;
  QLabel *fileNames;
  QLabel *yAxisTick;
  QLabel *xAxisTick;
  QLabel *yMouseLabel;
  QLabel *yMousePos;
  QLabel *dyMouseLabel;
  QLabel *dyMousePos;
  QLabel *xMouseLabel;
  QLabel *xMousePos;
  QLabel *dxMouseLabel;
  QLabel *dxMousePos;
  QLabel *plotInfo;
  QLabel *pHolder0;
  QLabel *pHolder1;
  QLabel *pHolder2;
  QLabel *pHolder3;

  QPushButton *legendToggle;

  QScrollBar *yAxisScroll;
  QScrollBar *xAxisScroll;

  PlotArea *plotFrame;

  QWidget *centralwidget;
  QGridLayout *gridLayout;
};

#endif
